package com.itheima.outdemo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        //从程序向磁盘中写数据  输出流
        //字节输出流
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("day12\\aaa\\abc.txt");
            fos.write(22255);//码表对应的字符  汉字编码解码不一致
        } catch (IOException e) {
            e.printStackTrace();
        } finally {//最终一定会被执行到

            if (fos!=null) {
                try {
                    fos.close();//必须要写
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
